<template>
  <div class="app-container">
    <!--
            {
    "id": 1,
    "create_datetime": "2023-08-06 22:55:44",
    "update_datetime": "2023-08-06 23:17:06",
    "creator_name": "admin",
    "checkin_datetime": "2023-08-06 23:17:06",
    "description": "",
    "modifier": "admin",
    "dept_belong_id": "1",
    "is_checkin": true,
    "checkout_notes": "许可证借出给管理员",
    "checkin_notes": "归还许可证",
    "creator": 1,
    "license": 8,
    "assigned_to": 1,
    "assigned_asset": null,
    "license_name": "测试许可证",
    "assigned_to_name": "管理员"
}
        -->
    <el-table :data="list" stripe size="mini">
      <el-table-column label="操作人" width="200" align="left" prop="creator_name" />
      <el-table-column label="许可证名称" width="200" align="left" prop="license_name" />
      <el-table-column label="借至用户" width="150" align="left" prop="assigned_to_name" />
      <el-table-column label="借至资产" width="150" align="left" prop="assigned_asset_name" />
      <el-table-column label="借出时间" width="180" align="left" prop="create_datetime" />
      <el-table-column label="借出备注" align="left" prop="checkout_notes" />
      <el-table-column label="归还时间" width="180" align="left" prop="checkin_datetime" />
      <el-table-column label="归还备注" width="180" align="left" prop="cheeckin_notes" />
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>

import { listLicenserecords } from "@/api/vadmin/assets/licenses";

export default {
  name: "UserCheckoutReport",
  data() {
    return {
      list: [],
      // 总条数
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 50
      }
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    getList() {
      listLicenserecords(this.queryParams).then(res => {
        this.list = res.data.results;
        this.total = res.data.count;
      });
    },
    clickAUser() {
      alert("暂未实现");
    }
  }
};
</script>

<style lang="scss" scoped></style>
